import React, { Component } from 'react'
import { Layout, Card, Divider, Modal } from 'antd'

import MeetingForm from './MeetingForm'
import Steps from './MeetingSteps';

// function PostMeetingModal(props) {}

export class NewMeeting extends Component {
  state = {
    current: 0,
  }
  render() {
    return (
      <Layout>
        <Layout style={{ marginLeft: '3%', marginRight: '3%' }}><Steps current={this.state.current} /></Layout>

        <Card hoverable>
          {/* { */}
            {/* this.state.current ? 
            <div style={{
              margin: 'auto',
              marginTop: '100px',
            }}>
              <Icon type="check-circle" theme="twoTone" /> &nbsp;
              <span>已提交 审核中</span>
            </div> :  */}
            <div>
              <Divider orientation="left">填写会议基本信息</Divider>
              <MeetingForm postSuccess={() => {
                this.setState({
                  current: 1,
                })
              }} />
            </div>
          {/* } */}
        </Card>
        <Modal 
          title="发起成功"
          onOk={() => {
            this.props.history.push('/my')
          }}
          onCancel={() => {this.setState({current: 0})}}
          visible={this.state.current === 1}
        >
          是否前往查看我的会议
        </Modal>
      </Layout>
    )
  }
}

export default NewMeeting
